<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title>类</title>
	</head>
	<body>
		<script type="text/javascript">
			function Parent() {this.name="tom";}
			Parent.prototype.hello=function () {
				alert("我是Parent的原型里的方法")}
			function Child() {this.age=12;}
			Child.prototype=new Parent();//Child继承Parent,通过原型，形成链条
			var child1=new Child();
		    child1.hello();
		    console.log(child1.age,child1.name)	
		</script>
	</body>
</html>
